//
//  Trace.h
//  airfight
//
//  Created by aaron more on 12-9-18.
//  Copyright (c) 2012年 moonriver. All rights reserved.
//

#ifndef airfight_Trace_h
#define airfight_Trace_h

#include "cocos2d.h"

USING_NS_CC;

enum
{
    MOVE_MOVEBY = 1,
    MOVE_BEZIERTWOBY = 2,
    MOVE_BEZIERTHREEBY = 3,
};

class Control : public CCObject
{
protected:
    CCPoint m_controlPoint; //控制点
public:
    Control();
    virtual ~Control();
    inline CCPoint getControlPoint() { return m_controlPoint; }
    inline void setControlPoint(float x,float y) { m_controlPoint = CCPointMake(x,y); }
};


class Move : public CCObject
{
    CC_SYNTHESIZE(int,m_moveType,MoveType); //移动类型
    CC_SYNTHESIZE(int,m_step,Step); //步骤
    CC_SYNTHESIZE(float,m_duration,Duration); //单次移动持续时间
    CC_SYNTHESIZE(int,m_angle,Angle); //角度
    CC_SYNTHESIZE(int,m_wish,Wish); //角度控制标识
    
protected:
    CCPoint m_endPoint; //移动点
    CCArray *m_controls; //贝赛尔控制点数组
    
public:
    
    Move();
    virtual ~Move();
    
    inline CCPoint getEndPoint() { return m_endPoint; }
    inline void setEndPoint(float x,float y) { m_endPoint = CCPointMake(x,y); }
    
    inline CCArray* getControls() { return m_controls; }
    inline void addControl(Control* p_control) { m_controls->addObject(p_control); }

};

class Trace : public CCObject
{

    CC_SYNTHESIZE(int,m_traceID,TraceID); //id

protected:
    CCArray *m_moves;
    
public:
    Trace();
    ~Trace();
    inline CCArray* getMoves() { return m_moves; }
    inline void addMove(Move* p_move) { m_moves->addObject(p_move); }
};
#endif
